<?php

namespace App\Http\Requests\Admin\AdminAction;

use App\Http\Requests\Request;

class StoreRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * 验证规则
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'required',
            'url' => 'required',
        ];
    }

    /**
     * 验证信息
     * @return array
     */

    public function messages()
    {
        return [
            'name.required' => '请填写名称',
            'url.required'  => '请填写URL',
            'parent_id.requried'=>'请选择父节点',

        ];
    }
}
